﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Domain.EntityInfo;
using Zocono.WCS.Domain.PlcWriteDbDomain;
using Zocono.WCS.Infrastructure.ApllicationDto;
using Zocono.WCS.Infrastructure.ApllicationDto.DtoWcsManage;

namespace Zocono.WCS.Application.AppConfigureManage
{
    public class PlcWriteDbInfoApp
    {
        private readonly IMapper _Mapper;
        private readonly IPlcWriteDbInfoService _PlcWriteDbInfoservice;


        public PlcWriteDbInfoApp(IMapper mapper, IPlcWriteDbInfoService PlcWriteDbInfoservice)
        {
            _Mapper = mapper;
            _PlcWriteDbInfoservice = PlcWriteDbInfoservice;
        }

        public async Task<long> AddPlcWriteDbInfoAsync(PlcWriteDbInfoDto PlcWriteDbInfoDto)
        {
            PlcWriteDbInfoDto.ObjectIsNullOrEmpty();//数据非空验证
            return await _PlcWriteDbInfoservice.AddPlcWriteDbInfoAsync(PlcWriteDbInfoDto);
        }

        public async Task<bool> DeletePlcWriteDbInfoAsync(long ID)
        {
            return await _PlcWriteDbInfoservice.DeletePlcWriteDbInfoAsync(ID);
        }

        public async Task<bool> UpdatePlcWriteDbInfoAsync(PlcWriteDbInfoDto PlcWriteDbInfoDto)
        {
            PlcWriteDbInfoDto.ObjectIsNullOrEmpty();
            return await _PlcWriteDbInfoservice.UpdatePlcWriteDbInfoAsync(PlcWriteDbInfoDto);
        }

        public async Task<PageDto<PlcWriteDbInfoDto>> GetPlcWriteDbInfoAsync(QueryPlcWriteDbInfoDto queryPlcWriteDbInfoDto)
        {
            return await _PlcWriteDbInfoservice.GetPlcWriteDbInfoAsync(queryPlcWriteDbInfoDto);
        }

        public async Task<PlcWriteDbInfoDto> GetPlcWriteDbInfoByIDAsync(long ID)
        {
            return await _PlcWriteDbInfoservice.GetPlcWriteDbInfoByIDAsync(ID);
        }

        public async Task<List<PlcWriteDbDto>> GetPlcWriteDbInfoAsync()
        {
            return await _PlcWriteDbInfoservice.GetPlcWriteDbInfoAsync();
        }

        public async Task<List<DispatchEquipmentPlanarState>> GetDispatchEquipmentPlanarStateInfoAsync(List<string> equipmentCodes)
        {
            return await _PlcWriteDbInfoservice.GetDispatchEquipmentPlanarStateInfoAsync(equipmentCodes);
        }
    }
}
